﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class MasterPage : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if ( Request.Cookies["CookieUserID"] != null)
        {
            HttpCookie CookieID;
            CookieID = Request.Cookies["CookieUserID"];
            lblWelcomeMsg.Text = "Welcome " + CookieID["Username"];
            divUserSignInLogin.Visible = false;
          
            divLogOut.Visible = true;

           
        }
        else
        {
            divUserSignInLogin.Visible = true;
          
            divLogOut.Visible = false;
        }
    }
    protected void lnkLogOut_Click(object sender, EventArgs e)
    {
        HttpCookie CookieMerchantID = new HttpCookie("CookieMerchantID");
        CookieMerchantID.Expires = DateTime.Now.AddDays(-30);
        HttpCookie CookieUserID = new HttpCookie("CookieUserID");
        CookieUserID.Expires = DateTime.Now.AddDays(-30);
        Response.Cookies.Add(CookieMerchantID);
        Response.Cookies.Add(CookieUserID);

        Response.Redirect("Login.aspx");
    }
}
